package com.chebaohui.iqs.service.impl.deal.util;

import com.chebaohui.iqs.entity.base.License;

/**
 * 请求接口行驶证参数判断工具类
 * 
 * @author regas_xie
 *
 */
public class LicenseUtil {

	/**
	 * 判断
	 * 
	 * @param license
	 * @return
	 */
	public static String deal(License license) {
		if (!CompanyUtil.valFrameNo(license.getFrameNo()))
			return "车架号错误:" + license.getFrameNo();

		if (!CompanyUtil.valLableNo(license.getLableNo()))
			return "厂牌型号错误:" + license.getLableNo();

		if (!CompanyUtil.valEngineNo(license.getEngineNo()))
			return "发动机号错误:" + license.getEngineNo();

		if (!CompanyUtil.valLicenceNo(license.getLicenceNo()))
			return "车牌号错误:" + license.getLicenceNo();

		if (!CompanyUtil.valName(license.getOwnerName()))
			return "车主姓名错误:" + license.getOwnerName();

		if (!CompanyUtil.valName(license.getOwnerName()))
			return "车主姓名错误:" + license.getOwnerName();

		if (!CompanyUtil.valTime(license.getRegisteredTime()))
			return "车辆注册时间错误:" + license.getRegisteredTime();

		if (!(license.getTransfer().equals("00") || license.getTransfer().equals("01")))
			return "车辆过户标志错误:" + license.getTransfer();

		if (license.getTransfer().equals("01") && !CompanyUtil.valTime(license.getTransferDate()))
			return "车辆过户时间错误:" + license.getTransferDate();

		return "true";
	}

}
